package Model;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class PersonTest {
	
	private Person person;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
		person = new Person(0, "pista", "doma", "044", "daleko", "055");
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testConstructor() {
		assertEquals(0, person.getId());
		assertEquals("pista", person.getName());
		assertEquals("doma", person.getAddress());
		assertEquals("044", person.getPostalCode());
		assertEquals("daleko", person.getCity());
		assertEquals("055", person.getPhone());
	}
	
	@Test
	public void testSetters() {
		//int newId = 5; we don't have setId()
		String newName = "tomi";
		String newAddress = "tu";
		String newPostalCode = "920";
		String newCity = "aalborg";
		String newPhone = "630";
		
		//person.setId(5); we don't have setId()
		person.setName(newName);
		person.setAddress(newAddress);
		person.setPostalCode(newPostalCode);
		person.setCity(newCity);
		person.setPhone(newPhone);

		assertEquals(0, person.getId());
		assertEquals(newName, person.getName());
		assertEquals(newAddress, person.getAddress());
		assertEquals(newPostalCode, person.getPostalCode());
		assertEquals(newCity, person.getCity());
		assertEquals(newPhone, person.getPhone());
	}

}
